package org.pdai.basic.generics;

public class GenericsMethodExample {
    public <T> T getObject(Class<T> c) throws InstantiationException, IllegalAccessException {
        T t = c.newInstance();
        return t;
    }

    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {
        GenericsMethodExample generic = new GenericsMethodExample();
        Object obj = generic.getObject(Class.forName("org.pdai.basic.generics.GenericsExample"));
        System.out.println("obj = " + obj);
    }
}
